/**
 * Created by lijingwen on 2015-02-07.
 */


/**
 *  footer copyright
 */

$(function() {
    var copyright = '<p>©2014-2015 内容银行</p>';
    $('footer').html(copyright);
});



/***
 * load_data
 * @function load data via ajax
 */


function load_data(path, query, indextype, success_callback, fail_callback) {
    switch (path) {
        //case '/ShowAllContents':success_callback(contentdjson) ;break;
        default: {
            $("#loading").fadeIn();
            $.ajax({
                url: path,
                data: query,
                type: 'GET',
                dataType: 'json',
                // dataType: "jsonp",
                // traditional: true,
                // jsonp: "callback",
                // jsonpCallback: "jsonpcallback",
                success: function(data) {
                    success_callback(data);
                    $("#loading").fadeOut();
                },
                error: function(e) {
                    fail_callback(e);
                }
            });
            break;
        }
    }

}

//session
var contentdjson = [{
    'contentid': 1,
    'name': '奔跑吧兄弟',
    'nickname': ['跑男', '奔跑吧家族']
}];

function defaultsuccess() {
    alert('Success.operate finised!');
}

function defaulterror() {
    alert('Error.operate failed!');
}
